
import pymysql
if __name__ == '__main__':
    conn = pymysql.connect(host="localhost", port=3308, db="xuexiao", user="root", password="root1234")
    cursor = conn.cursor()
    sql="select no,name,qq,telephone,addr,birthday,sex from student"
    r=cursor.execute(sql)
    print("????",r)
    results=cursor.fetchall()#???获取数据
    for x in results:
        for i in x:
            print(i,end=" ")
        print()
        #print("学号：",x[0],"，姓名：",x[1],"qq:",x[2],"生日：",x[5])
    conn.close()